package com.jackaltsc.mydemodatastorage.contentprovider;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * SQLite数据库创建和版本管理的类
 */
public class MySQLiteHelper extends SQLiteOpenHelper {

    //表名
    public static final String TABLEC_NAME = "tablecptest";
    //版本
    private static final int DB_VERSION = 1;

    public MySQLiteHelper(Context context) {
        super(context, TABLEC_NAME, null, DB_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {

        String strSQL = "create table " + TABLEC_NAME +
                "(id integer primary key autoincrement," +
                "name varchar(64)," +
                "address varchar(64))";

        db.execSQL(strSQL);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    }
}
